Kernelized spatial-contextual image classification

ABSTRACT

Kernelized spatial-contextual image classification is disclosed. One embodiment comprises generating a first spatial-contextual model to represent a first image, the first spatial-contextual model having a plurality of interconnected nodes arranged in a first pattern of connections with each node connected to at least one other node, generating a second spatial-contextual model to represent a second image using the first pattern of connections, and estimating the distance between corresponding nodes in the first spatial-contextual model and the second spatial-contextual model based on a relationship with adjacent connected nodes to determine a distance between the first image and the second image.

BACKGROUND

Image/video classification involves categorizing a collection of unlabeled images into a set of predefined classes for semantic level image retrieval. In some approaches, images are modeled by segmenting the image into patches. Then, the patches are compared to a reference image based on aspects of each patch, such as color, texture, etc. An additional factor that may be considered in image classification is the spatial context between the local patches of images. Spatial-contextual models attempt to depict the spatial structures of images in a class by constructing one common model for each image category.

In one example, a two dimensional Hidden Markov Model (2D HMM) may be used for image categorization, by generating a learned model from a training set of images for each image class. Then, the learned model is used to score the probability of an unlabeled image belonging to a certain class of images. However, a subject image category may have a large intra-class variance, making it is difficult to represent various spatial contexts in different images using a single model. For example, the images for a specific category may differ by view, such as top view, side view, front view and back view. Each view may have a different spatial context related to its respective local patches. These differences may reduce the depictive ability of a single model to capture a large intra-class variance between images.

SUMMARY

Accordingly, various embodiments for kernelized spatial-contextual image classification are described below in the Detailed Description. For example, one embodiment comprises generating a first spatial-contextual model to represent a first image, the first spatial-contextual model having a plurality of interconnected nodes arranged in a first pattern of connections with each node connected to at least one other node, generating a second spatial-contextual model to represent a second image using the first pattern of connections, and estimating the distance between corresponding nodes in the first spatial-contextual model and the second spatial-contextual model based on a relationship of adjacent connected nodes to determine a distance between the first image and the second image.

This Summary is provided to introduce concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of an embodiment of a system for kernelized spatial-contextual image classification.

FIG. 2 shows an image of a car in the perspective view with a dependency tree hidden Markov model.

FIG. 3 shows representative nodes in the dependency tree hidden Markov model from FIG. 2.

FIG. 4 shows a process flow depicting an embodiment of a method for kernelized spatial-contextual image classification.

DETAILED DESCRIPTION

Generally, a prototype set of spatial-contextual models may be constructed by leveraging a kernel method in contrast to using only a single model for an image category in image classification. Such an approach provides the representation ability of spatial-contextual models as well as the classification ability of kernel methods. For example, this approach can generate a distance measure between different spatial-contextual models by integrating joint appearance-spatial image features. Such a distance measure can be efficiently computed in a recursive formulation that may also scale well to a range of image sizes, and upper-bounded for the distance between the two models can be computed.

FIG. 1 shows an example of an embodiment of a system 100 to categorize a plurality of unlabeled images comprising a computing device 110 with an input, a memory 120, a processor 115 in communication with the input and the memory, and a computer program 130 in memory 120 that may be run by processor 115.

Computing device 110 further comprises a model generation module 140 in communication with a distance module 150, and a categorization module 170. Model generation module 140 may be configured to generate a plurality of spatial-contextual models of images 107 from an image collection 105. Distance module 150 may further include a pattern service 152, and uses the pattern service 152 to recognize nodal relationships in spatial-contextual models and calculate an image distance 155 between spatial-contextual models. Categorization module 170 then uses the image distance 155 to generate a categorized image 190, as described below.

In one embodiment, model generation module 140 may be configured to generate a first Dependency Tree Hidden Markov Model (DT-HMM) to represent a first image and a second DT-HMM to represent a second image. Then, the distance module 150 may to calculate an image distance 155 between the first DT-HMM and the second DT-HMM based on formulas for different distance estimations based on a nodal structure in corresponding nodes of the first DT-HMM and the second DT-HMM. In this way, categorization module 170 to receive the image distance and to generate a kernelized spatial-contextual model using the image distance.

In one embodiment, an upper-bounded distance between two images may be obtained by a Maximum A Posteriori (MAP) adaptation where each statistical model for an image is adapted from a Universal Reference Model (URM). For example, a URM may be constructed from a collection of referential images. Therefore, once the upper-bound is obtained, a kernel function can be generated in a kernel-based classifier, such as Support Vector Machine (SVM), and then used for image categorization.

As described above, a disadvantage of a conventional 2D-HMM approach is the use of a single model to represent an image class. This can be problematic when an image class has a large intra-class variance. Briefly turning to FIG. 2, an image 200 of a car 215 in perspective view with a DT-HMM structure 210 overlaying the image. However, other images of a car may be from the front of the car, the back, the side, the top, etc. Each of these has a different spatial-context based on the image perspective. If a single model is used to represent an image class, the intra-class variance of the different perspectives would therefore generate a range of distance calculations based on different image perspectives.

In one embodiment, a set of prototype models may be constructed, each model capturing one prototype in a subject class. For example, for an image class of the car 215, multiple prototype models may be constructed to represent different perspectives of car 215. Then, the multiple prototypes can be combined to generate a spatial-contextual model for a car class.

Referring back to FIG. 1, an embodiment computing device 110 may comprise an adaptation module 160 in communication with the categorization module 170, wherein the adaptation module 160 may be configured to train a universal reference model 165 from a plurality of representative images. In this way, the categorization module may generate a set of kernelized spatial-contextual models to accommodate intra-class variance in a range of representative images containing a subject semantic content.

We now describe aspects of this approach illustrated in FIG. 1 in more detail. Given a set of training images {x_(i)}_(i=1) ^(n) and associated labels {y_(i)}_(i=1) ^(n), an individual 2D HMM {Θ}_(i=1) ^(n) may be generated based on each image. By computing a similarity measure between each of these models, a kernel function k(Θ, Θ_(i)) can be calculated between two models Θ, {tilde over (Θ)}. Using this kernel function, a prediction function can then be learned using a SVM approach according to the following equation:

$\begin{matrix} {{f(\Theta)} = {{sgn}\left\{ {{\sum\limits_{i = 1}^{n}{y_{i}\alpha_{i}{k\left( {\Theta,\Theta_{i}} \right)}}} + b} \right\}}} & (1) \end{matrix}$

where sgn {.} represents the sign function.

Therefore, Θ and Θ_(i) represent the 2D-HMM learned from the images and α_(i) and b provide a coefficient and bias in equation (1). This function may be used to provide a predicted label for an image associated with model Θ. Additionally, Θ_(i)s associated with α_(i)≠0 may act as support vectors in a SVM approach and may then be considered as prototypes for an image class to discriminate the image class from the other categories. Referring back to the car example, the images of the car from different perspectives may be used to create a set of support vectors that may be combined in equation (1). Next, a similarity measure between different images based on their respective 2D-HMM will be described.

As stated above, an individual 2D-HMM may first be used to represent an image. In this way, a 2D-HMM is trained from an associated image. In contrast, in a spatial-contextual approach, a representation model (i.e., 2D-HMM) may be separately used from a prediction model (i.e., SVM). For the representation model, a model is fit into an image to represent it. For the prediction model, a corresponding SVM model may be trained based on the obtained similarities between the fitted models. Therefore, such a framework combines the 2D-HMM ability to represent the spatial contexts of images, as well as the prediction ability of SVM to discriminate image classes.

We now describe a DT-HMM probabilistic modeling approach in more detail. Similar to a 2D-HMM, in a DT-HMM approach a 2D observation may be denoted by O={o_(i,j), i=1, . . . , R, j=1, . . . , C}, where each O_(i,j) is a feature vector of a block (i, j) in an image. For Q states {1, . . . , Q}, the state of a block (i, j) is denoted by s_(i,j). Under the dependency assumption in 2D-HMM, each state s_(i,j) then depends on its two neighbors s_(i−1, j), s_(i,j−1) which in turn causes the computation complexity of a learning procedure and an inference procedure to grow considerably as image size increases. In contrast, in a DT-HMM approach, an assumption is made that s_(i,j) depends on one neighbor at a time. This neighbor may be a horizontal neighbor or a vertical neighbor, depending on a random variable t_(i,j) with the following distribution:

$\begin{matrix} {{P\left( {{t\left( {i,j} \right)} = \left( {{i - 1},j} \right)} \right)} = {{P\left( {{t\left( {i,j} \right)} = \left( {i,{j - 1}} \right)} \right)} = \frac{1}{2}}} & (2) \end{matrix}$

It is worth noting that for the first row or the first column of a DT-HMM, t_(i,j) has only one valid horizontal or vertical value and the root node T (1, 1) is not defined. Therefore, a transition probability distribution can be simplified for vertical transition probability distribution P_(V) and for horizontal transition probability distribution P_(H) respectively as:

P(s _(i,j) |s _(i−1,j) ,s _(i,j−1))={P _(V)(s _(i,j) |s _(i−1,j)),t(i,j)=(i−1,j) and

P(s _(i,j) |s _(i−1,j) ,s _(i,j−1))={P _(H)(s _(i,j) |s _(i−1,j)),t(i,j)=(i−1,j)  (3)

In this example, the random variables t for all (i,j) therefore define a tree-structured dependency over all positions with (1,1) as the root. FIG. 3 illustrates such an example dependency tree structure and illustrates example nodal structures, including node arrangement 310 with no successor node, node arrangement 320 with a horizontal successor node, node arrangement 330 with a vertical successor node, and node arrangement 340 with a horizontal and a vertical successor node. In one embodiment, these different node structures may use a corresponding different distance calculations between corresponding DT-HMMs, as explained in the following paragraphs.

In a DT-HMM, given a state s_(i,j), an observation o_(i,j) may be generated according to distribution P(o_(i,j)|s_(i,j)). For example, a Gaussian Mixture Model (GMM) may provide an observation distribution. In a multi-modal setting, the observation o_(i,j) may have M feature cues {o_(i,j) ^(k)}_(k−1) ^(M) from different sources. By assuming these M types of features can be generated independently once a corresponding state s_(i,j) is given, we have:

$\begin{matrix} \begin{matrix} {{P\left( {{\left\{ o_{i,j}^{k} \right\}_{k = 1}^{M}s_{i,j}} = q} \right)} = {\prod\limits_{k = 1}^{M}\; {P\left( {{o_{i,j}^{k}s_{i,j}} = q} \right)}}} \\ {= {\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{N\left( {{o_{i,j}^{k}\mu_{k,l}^{q}},\sum\limits_{k,l}^{q}}\; \right)}}}}} \end{matrix} & (4) \end{matrix}$

where

${\lambda_{k,l}^{q},\mu_{k,l}^{q},\sum\limits_{k,l}^{q}}\;$

is a mixing coefficient, a mean vector and a covariance matrix of lth Gaussian component for the kth modality, respectively, given the current state is q.

For simplicity, the covariance matrix may be assumed to be diagonal. The independence assumption holds given hidden states are fixed, but for the 2D observation such an independence assumption does not hold across different modalities, i.e. P(O¹, . . . O^(M))≠P(O¹) . . . P(O^(M)).

A DT-HMM may be used to encode both the appearance and the spatial structure of an image. If a distance is computed between DT-HMMs, an appearance-spatial discrimination can be measured across the images. The Kullback-Leibler Divergence (KLD) from information theory provides a distance measure between the statistical models.

Specifically, a DT-HMM may be specified by the parameter set Θ={π, a^(H), a^(V), λ,μ,Σ}, where π is the initial state distribution; a^(H), a^(V) is the horizontal and vertical transition matrix with a_(m,n) ^(H)=P_(H)(s_(i,j)=n|s_(i,j−1)=m), a_(m,n) ^(V)=P_(H)(s_(i,j)=n|s_(i−1,j)=m); and λ, μ,Σ are the parameters for the observation distribution specified in equation (4). Using this observation distribution, a joint distribution of the 2D observation O={o_(i,j) ^(k), i=1, . . . , R, j=1, . . . , C, k=1, . . . , M} and state S={s_(i,j), i=1, . . . , R, j=1, . . . , C} is:

P(O,S|Θ)=P(O|S,Θ)P(S|Θ)=Π_(i,j) P(o _(i,j) |s _(i,j),Θ)P(s _(i,j) |s _(i=1,j) ,s _(i,j−1))  (5)

and a 2D observation distribution can be obtained by summarizing S as

$\begin{matrix} {{P\left( {O\Theta} \right)} = {\sum\limits_{S}{P\left( {O,{S\Theta}} \right)}}} & (6) \end{matrix}$

Therefore, the KLD between two DT-HMMs Θ, {tilde over (Θ)} is:

$\begin{matrix} {{KL} = {\left( {\Theta {}\overset{\sim}{\Theta}} \right) = {\int{{P\left( {O\Theta} \right)}\log \frac{P\left( {O\Theta} \right)}{P\left( {O\overset{\sim}{\Theta}} \right)}}}}} & (7) \end{matrix}$

Unfortunately, there is not a closed form expression for the KLD between these two DT-HMMs, but an approximation may be used. The approximation is motivated from the following lemma that is based on the log-sum inequality: Given two mixture distributions

${f = {{\sum\limits_{i = 1}^{L}{w_{i}f_{i}\mspace{14mu} {and}\mspace{14mu} g}} = {\sum\limits_{i = 1}^{L}{v_{i}g_{i}}}}},$

the KLD between them is upper bounded by:

$\begin{matrix} \left. {\left. {\left. {{{KL}\left( f \right.}g} \right) \leq {{{KL}\left( w \right.}v}} \right) + {\sum\limits_{i = 1}^{L}{w_{i}{{KL}\left( f_{i} \right.}g_{i}}}} \right) & (8) \end{matrix}$

where

${\left. {{{KL}\left( w \right.}v} \right) = {\sum\limits_{i = 1}^{L}{w_{i}\log \frac{w_{i}}{v_{i}}}}},$

following the log-sum inequality.

Given this lemma, the KLD between DT-HMMs can be computed as follows. Let T(i, j) be a sub-tree rooted at position (i,j), and β_(i,j)(q) be a probability that the portion of a respective image is covered by T(i, j) with a state q in position (i,j). Then the 2D observation distribution is:

$\begin{matrix} {{P\left( {O\Theta} \right)} = {\sum\limits_{q = 1}^{Q}{\pi_{q}{\beta_{1,1}(q)}}}} & (9) \end{matrix}$

Accordingly, the KLD between two DT-HMMs may be calculated according to:

$\begin{matrix} \left. {\left. {{{KL}\left( \Theta  \right.}\overset{\sim}{\Theta}} \right) = {{{KL}\left( {{\sum\limits_{q = 1}^{Q}{\pi_{q}{\beta_{1,1}(q)}\left. {\sum\limits_{q = 1}^{Q}{{\overset{\sim}{\pi}}_{q}{{\overset{\sim}{\beta}}_{1,1}(q)}}} \right)}} \leq {{{KL}\left( \pi  \right.}\overset{\sim}{\pi}}} \right)} + {\sum\limits_{q = 1}^{Q}{\pi_{q}{{KL}\left( {\beta_{1,1}(q)} \right.}{\beta_{1,1}(q)}}}}} \right) & (10) \end{matrix}$

The term KL(β_(1,1)(q)|{tilde over (β)}_(1,1) (q)) from the right-hand side of equation (10), may be computed recursively. For example, the term may be computed based on an extension of Baum-Welch algorithm by considering the following cases, where each case corresponds to one of the node arrangements depicted in FIG. 3:

In reference to node arrangement 310, if (i,j) is a leaf in T(i, j) that has no child node, the term may be calculated according to:

β_(i,j)(q)=P(o _(i,j) |s _(i,j) =q)  (11)

For notation purposes, N(o_(i,j) ^(k)|μ_(k,l) ^(q),Σ_(k,l) ^(q)), and N(o_(i,j) ^(k)|{tilde over (μ)}_(k,l) ^(q),{tilde over (Σ)}_(k,l) ^(q)) may be denoted by N_(i,j) ^(K) and Ñ_(i,j) ^(K), respectively. Next, by substituting equation (4) into the above equation (11), the KLD can be computed as:

$\begin{matrix} \begin{matrix} {{KL}\left( {{{\beta_{i,j}(q)}\left. {{\overset{\sim}{\beta}}_{i,j}(q)} \right)} = {{KL}\left( {\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}}}} \right.{\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}}}}} \right)} \\ {= {\sum\limits_{k = 1}^{M}{{KL}\left( {{\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}\left. {\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}} \right)}} \leq} \right.}}} \\ {{{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( \lambda_{k,.}^{q} \right.}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}\left. N_{k,l}^{q} \right)} \right\}}}}}} \end{matrix} & (12) \end{matrix}$

where

${{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} = {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}\log {\frac{\lambda_{k,l}^{q}}{{\overset{\sim}{\lambda}}_{k,l}^{q}}.}}}$

Here, the second equality follows the chain rule for KLD and the inequality comes from the lemma.

In reference to node arrangement 320, if (i,j) has only a horizontal successor, we have the following recursive equation:

$\begin{matrix} {{\beta_{i,j}(q)} = {{P\left( {\left. o_{i,j} \middle| s_{i,j} \right. = q} \right)}{\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}}}}} & (13) \end{matrix}$

thus we have:

$\begin{matrix} {{{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = 1},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{H}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}}}}} & (14) \end{matrix}$

Where

$\left. {{{KL}\left( \alpha_{q,.}^{H} \right.}{\overset{\sim}{\alpha}}_{q,.}^{H\mspace{11mu}}} \right) = {\sum\limits_{l = 1}^{Q}{\alpha_{q,l}^{H}\log \frac{\alpha_{q,l}^{H}}{{\overset{\sim}{\alpha}}_{q,l}^{H}}}}$

accounts for discrimination information of the horizontal spatial structure between the respective two images. In this example, the first equality follows the chain rule for KLD and the inequality comes from the lemma.

Similarly, and in reference to node arrangement 330, if (i,j) has only a vertical successor, we have:

$\begin{matrix} {{{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( \lambda_{k,.}^{q} \right.}\lambda_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}\left. {\overset{\sim}{N}}_{k,l}^{q} \right)} \right\}}}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{{i + 1},j}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{{i + 1},j}\left( q^{\prime} \right)}} \right)}}}}} & (15) \end{matrix}$

In similar fashion to the previous example,

${{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} = {\sum\limits_{l = 1}^{Q}{\alpha_{q,l}^{V}\log \; \frac{\alpha_{q,l}^{V}}{{\overset{\sim}{\alpha}}_{q,l}^{V}}}}$

accounts for the discrimination of the vertical spatial structure between the two images.

Referring now to node arrangement 340, if (i,j) has both a horizontal and a vertical successor, we have:

$\begin{matrix} {{\beta_{i,j}(q)} = {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = 1},\Theta} \right)} \cdot \left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}}} \right) \cdot \left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{\beta_{{i + 1},j}\left( q^{\prime} \right)}}} \right)}} & (16) \end{matrix}$

resulting in:

$\begin{matrix} {{{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{{i + 1},j}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{{i + 1},j}\left( q^{\prime} \right)}} \right)}}}}}} & (17) \end{matrix}$

Note that, since a DT-HMM has a tree structure, two sub trees T(i+1,j) and T(i,j+1) may have no common nodes. Therefore the two distributions

$\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}}} \right)\mspace{14mu} {and}\mspace{14mu} \left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{\beta_{{i + 1},j}\left( q^{\prime} \right)}}} \right)$

may be independent, thus in the first equality we can apply the chain rule for KLD.

Finally, the KLD between the two d-dimensional normal distributions N_(k,l) ^(q),Ñ_(k,l) ^(q) in the above equations has a closed-from expression as shown in the following formula:

$\begin{matrix} {{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)} = {\frac{1}{2}\begin{pmatrix} {{\log \frac{{\overset{\sim}{\Sigma}}_{k,l}^{q}}{\Sigma_{k,l}^{q}}} + {{Tr}\left( {\left( {\overset{\sim}{\Sigma}}_{k,l}^{q} \right)^{- 1}\Sigma_{k,l}^{q}} \right)} +} \\ {{\left( {\mu_{k,l}^{q} - {\overset{\sim}{\mu}}_{k,l}^{q}} \right)^{T}\left( {\overset{\sim}{\Sigma}}_{k,l}^{q} \right)^{- 1}\left( {\mu_{k,l}^{q} - {\overset{\sim}{\mu}}_{k,l}^{q}} \right)} - d} \end{pmatrix}}} & (18) \end{matrix}$

Referring now to FIG. 4, a process flow depicting an embodiment of a method 400 for categorizing a plurality of unlabeled images is shown. First, as indicated in block 410, method 400 comprises generating a first spatial-contextual model to represent a first image, the first spatial-contextual model having a plurality of interconnected nodes arranged in a first pattern of connections with each node connected to at least one other node. In one example, a spatial-contextual model may be a Dependency Tree Hidden Markov Model (DT-HMM).

Method 400 also comprises generating a second spatial-contextual model to represent a second image, the second spatial-contextual model having a plurality of interconnected nodes arranged in the first pattern of connections, as indicated in block 420.

Next, method 400 comprises determining a relationship of adjacent nodes that each node is connected with in the first pattern of connections, as indicated at 430. Then, as depicted in block 440, method 400 comprises calculating a distance between corresponding nodes in the first spatial-contextual model and the second spatial-contextual model based on the relationship of adjacent connected nodes to determine a distance between the first image and the second image.

In some embodiments, method 400 may further comprise training a Universal Reference Model from a plurality of referential images, and adapting the first spatial-contextual model and the second spatial-contextual model to the Universal Reference Model prior to calculate a distance between corresponding nodes. In one embodiment, calculating a distance between corresponding nodes involves estimating the distance using an upper-bounded Kullback-Leibler Divergence based on the relationship of adjacent nodes.

It will be appreciated that the embodiments described herein may be implemented, for example, via computer-executable instructions or code, such as programs, stored on a computer-readable storage medium and executed by a computing device. Generally, a program involves routines, objects, components, or data structures, and the like that perform particular tasks or implement particular abstract data types. As used herein, the term “program” may connote a single program or multiple programs acting in concert, and may be used to denote applications, services, or any other type or class of program. Likewise, the terms “computer” and “computing device” as used herein include any device that electronically executes one or more programs, including, but not limited to, personal computers, servers, laptop computers, hand-held devices, cellular phones, microprocessor-based programmable consumer electronics and other computer image processing devices.

It will further be understood that the configurations and/or approaches described herein are exemplary in nature, and that these specific embodiments or examples are not to be considered in a limiting sense, because numerous variations are possible. The specific routines or methods described herein may represent one or more of any number of processing strategies. As such, various acts illustrated may be performed in the sequence illustrated, in other sequences, in parallel, or in some cases omitted. Likewise, the order of any of the above-described processes is not necessarily required to achieve the features and/or results of the embodiments described herein, but is provided for ease of illustration and description. The subject matter of the present disclosure includes all novel and nonobvious combinations and subcombinations of the various processes, systems and configurations, and other features, functions, acts, and/or properties disclosed herein, as well as any and all equivalents thereof. 

1. A method for categorizing a plurality of unlabeled images, the method comprising: generating a first spatial-contextual model to represent a first image, the first spatial-contextual model having a plurality of interconnected nodes arranged in a first pattern of connections with each node connected to at least one other node; generating a second spatial-contextual model to represent a second image, the second spatial-contextual model having a plurality of interconnected nodes arranged in the first pattern of connections; determining a relationship of adjacent nodes that each node is connected with in the first pattern of connections; and calculating a distance between corresponding nodes in the first spatial-contextual model and the second spatial-contextual model based on the relationship of adjacent connected nodes to determine a distance between the first image and the second image.
 2. The method of claim 1, wherein calculating a distance between corresponding nodes involves estimating the distance using an upper-bounded Kullback-Leibler Divergence based on the relationship of adjacent nodes.
 3. The method of claim 1, wherein the first spatial-contextual model and the second spatial-contextual model are each a Dependency Tree Hidden Markov Model (DT-HMM).
 4. The method of claim 2, wherein the upper-bounded Kullback-Leibler Divergence is calculated using a formula: ${{KL}\left( {\Theta {}\overset{\sim}{\Theta}} \right)} = {{{KL}\left( {\sum\limits_{q = 1}^{Q}{\pi_{q}{\beta_{1,1}(q)}{}{\sum\limits_{q = 1}^{Q}{{\overset{\sim}{\pi}}_{q}{{\overset{\sim}{\beta}}_{1,1}(q)}}}}} \right)} \leq {{{KL}\left( {\pi {}\overset{\sim}{\pi}} \right)} + {\sum\limits_{q = 1}^{Q}{\pi_{q}{{KL}\left( {{\beta_{1,1}(q)}{}{{\overset{\sim}{\beta}}_{1,1}(q)}} \right)}}}}}$
 5. The method of claim 4, further comprising: training a Universal Reference Model from a plurality of referential images; and adapting the first spatial-contextual model and the second spatial-contextual model to the Universal Reference Model prior to calculate a distance between corresponding nodes.
 6. The method of claim 4, wherein if each of the corresponding nodes are not connected with a successor node, the method further comprising calculating the upper-bounded Kullback-Leibler Divergence using a formula: $\begin{matrix} {{{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{KL}\left( {\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}{}{\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}}}}}} \right)}} \\ {= {{\sum\limits_{k = 1}^{M}{{KL}\left( {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}{}{\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}}}} \right)}} \leq}} \\ {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}}} \end{matrix}$
 7. The method of claim 4, wherein if each of the corresponding nodes are connected with a vertical successor node, the method further comprising calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{{i + 1},j}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{{i + 1},j}\left( q^{\prime} \right)}} \right)}}}}$
 8. The method of claim 4, wherein if each of the corresponding nodes are connected with a horizontal successor node, the method further comprising calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}}}}$
 9. The method of claim 4, wherein if each of the corresponding nodes are connected with a vertical successor node and a horizontal successor node, the method further comprising calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{{i + 1},j}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{{i + 1},j}\left( q^{\prime} \right)}} \right)}}}}}$
 10. A computer-readable medium comprising instructions executable by a computing device to categorize a plurality of unlabeled images, the instructions being executable to perform a method comprising: generating a first spatial-contextual model to represent a first image, the first spatial-contextual model having a plurality of interconnected nodes arranged in a first pattern of connections with each node connected to at least one other node; generating a second spatial-contextual model to represent a second image, the second spatial-contextual model having a plurality of interconnected nodes arranged in the first pattern of connections; training a Universal Reference Model from a plurality of referential images; adapting the first spatial-contextual model and the second spatial-contextual model to the Universal Reference Model; determining a relationship of adjacent nodes that each node is connected with in the first pattern of connections; and calculating a distance between corresponding nodes in the first spatial-contextual model and the second spatial-contextual model based on the relationship of adjacent connected nodes.
 11. The computer-readable medium of claim 10, wherein adapting the first spatial-contextual model and the second spatial-contextual model to the Universal Reference Model comprises a Maximum A Posteriori technique.
 12. The computer-readable medium of claim 10, wherein calculating a distance between corresponding nodes involves estimating the distance using an upper-bounded Kullback-Leibler Divergence based on the relationship of adjacent nodes.
 13. The computer-readable medium of claim 10, wherein the first spatial-contextual model and the second spatial-contextual model are each a Dependency Tree Hidden Markov Model (DT-HMM).
 14. The computer-readable medium of claim 12, wherein the upper-bounded Kullback-Leibler Divergence is calculated using a formula: ${{KL}\left( {\Theta {}\overset{\sim}{\Theta}} \right)} = {{{KL}\left( {\sum\limits_{q = 1}^{Q}{\pi_{q}{\beta_{1,1}(q)}{}{\sum\limits_{q = 1}^{Q}{{\overset{\sim}{\pi}}_{q}{{\overset{\sim}{\beta}}_{1,1}(q)}}}}} \right)} \leq {{{KL}\left( {\pi {}\overset{\sim}{\pi}} \right)} + {\sum\limits_{q = 1}^{Q}{\pi_{q}{{KL}\left( {{\beta_{1,1}(q)}{}{{\overset{\sim}{\beta}}_{1,1}(q)}} \right)}}}}}$
 15. The computer-readable medium of claim 14, wherein if each of the corresponding nodes are not connected with a successor node, the medium further comprising instructions for calculating the upper-bounded Kullback-Leibler Divergence using a formula: $\begin{matrix} {{{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{KL}\left( {\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}{}{\prod\limits_{k = 1}^{M}{\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}}}}}} \right)}} \\ {= {{\sum\limits_{k = 1}^{M}{{KL}\left( {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}N_{k,l}^{q}{}{\sum\limits_{l = 1}^{N}{{\overset{\sim}{\lambda}}_{k,l}^{q}{\overset{\sim}{N}}_{k,l}^{q}}}}} \right)}} \leq}} \\ {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}}} \end{matrix}$
 16. The system of claim 14, wherein if each of the corresponding nodes are connected with a horizontal successor node, the medium further comprising instructions for calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}}}}$
 17. The computer-readable medium of claim 13, wherein if each of the corresponding nodes are connected with a vertical successor node, the medium further comprising instructions for calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}}}$
 18. The computer-readable medium of claim 13, wherein if each of the corresponding nodes are connected with a vertical successor node and a horizontal successor node, the medium further comprising instructions for calculating the upper-bounded Kullback-Leibler Divergence using a formula: ${{KL}\left( {{\beta_{i,j}(q)}{}{{\overset{\sim}{\beta}}_{i,j}(q)}} \right)} = {{{{KL}\left( {{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\Theta} \right)}{}{P\left( {{\left. o_{i,j} \middle| s_{i,j} \right. = q},\overset{\sim}{\Theta}} \right)}} \right)} + {{KL}\left( {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{\sum\limits_{q^{\prime} = 1}^{Q}{{\overset{\sim}{\alpha}}_{q,q^{\prime}}^{H}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}}}}} \right)}} \leq {{\sum\limits_{k = 1}^{M}\left\{ {{{KL}\left( {\lambda_{k,.}^{q}{}{\overset{\sim}{\lambda}}_{k,.}^{q}} \right)} + {\sum\limits_{l = 1}^{N}{\lambda_{k,l}^{q}{{KL}\left( {N_{k,l}^{q}{}{\overset{\sim}{N}}_{k,l}^{q}} \right)}}}} \right\}} + {{KL}\left( {\alpha_{q,.}^{H}{}{\overset{\sim}{\alpha}}_{q,.}^{H}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{H}{{KL}\left( {{\beta_{i,{j + 1}}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{i,{j + 1}}\left( q^{\prime} \right)}} \right)}}} + {{KL}\left( {\alpha_{q,.}^{V}{}{\overset{\sim}{\alpha}}_{q,.}^{V}} \right)} + {\sum\limits_{q^{\prime} = 1}^{Q}{\alpha_{q,q^{\prime}}^{V}{{KL}\left( {{\beta_{{i + 1},j}\left( q^{\prime} \right)}{}{{\overset{\sim}{\beta}}_{{i + 1},j}\left( q^{\prime} \right)}} \right)}}}}}$
 19. A system to categorize a plurality of unlabeled images, the system with an input, a memory, and a processor in communication with the input and the memory, the system comprising: a model generation module configured to generate a first dependency tree hidden Markov model to represent a first image, the model generation module further configured to generate a second dependency tree hidden Markov model to represent a second image; a distance module in communication with the model generation module, the distance module configured to calculate an image distance between the first dependency tree hidden Markov model and the second dependency tree hidden Markov model; and a categorization module to receive the image distance and to generate a kernelized spatial-contextual model using the image distance.
 20. The system of claim 19, further comprising an adaptation module in communication with the categorization module, the adaptation module being configured to train a universal reference model from a plurality of representative images and the categorization module being further configured to generate a set of kernelized spatial-contextual models. 